<template>
  <div>
      <h3>注册</h3>
      账号 <input type="text" v-model="username">
      密码 <input type="password" v-model="password">
      <button @click="sub">注册</button>
  </div>
</template>

<script>
export default {
    data(){
        return {
            username:'',
            password:''
        }
    },
    methods:{
        sub:function(){
            let data = {
                "username":this.username,
                "password":this.password
            }
            this.axios({
                url:'http://127.0.0.1:8000/app03/register/',
                method:'post',
                data:data
            }).then(res=>{
                alert(res.data.msg);
            })
        }
    }
}
</script>

<style>

</style>